from odoo import api, fields, models, _


class DescM(models.Model):
    _name = 'check.desc'
    _description = u"费用冲红"


    # 选择房间
    hou_id = fields.Many2one(
        'check.house',
        '房间号',
        required=True,
    )

    # 宾客
    guest_id = fields.Many2one(
        related='hou_id.guest_id',
    )

    Money = fields.Monetary(
        '押金总额',
        'currency_id',
        related='guest_id.Money',
    )
    total_consume = fields.Monetary(
        '当前消费',
        'currency_id',
        related='guest_id.Total_consume'
    )

    subMoney = fields.Monetary(
        '冲抵费用',
        'currency_id',
    )
    currency_id = fields.Many2one('res.currency',
                                  default=lambda self: self.env.user.company_id.currency_id
                                  )  # price helper

    note = fields.Char(
        "备注"
    )


